<HTML><HEAD><TITLE>tent_trace_array(+Stream, +Name, +ArrayList)</TITLE>
</HEAD><BODY>[ <A HREF="index.html">library(tentative)</A> | <A HREF="../../index.html">Reference Manual</A> | <A HREF="../../fullindex.html">Alphabetic Index</A> ]
<H1>tent_trace_array(+Stream, +Name, +ArrayList)</H1>
Simple tracing facility for several variables
<DL>
<DT><EM>Stream</EM></DT>
<DD>A stream identifier
</DD>
<DT><EM>Name</EM></DT>
<DD>Usually atom or string (but general term allowed)
</DD>
<DT><EM>ArrayList</EM></DT>
<DD>Array or list of tentative variables
</DD>
</DL>
<H2>Description</H2>

	<P>
	This predicate sets up a demon that prints a message whenever the
	tentative value of one of the variables in ArrayList changes.
	The message is printed onto Stream and is of the form
	</P><PRE>
		Name[Index]: chg(Old,New)
	</PRE><P>
	where Index is the index of the changed variable in the given
	array, Old is the tentative value before the change, and New
	the tentative value after the change.
	</P><P>
	Another way of tracing tentative value changes is by using the
	Visualisation Tools.
	</P>
    
<H3>Modes and Determinism</H3><UL>
<LI>tent_trace_array(+, +, +) is det
</UL>
<H2>Examples</H2>
<PRE>
    ?- Xs = [X,Y], tent_set(Xs, [1,2]),
      tent_trace_array(output, hello, Xs),
      tent_set(X, 7),
      tent_set(Y, 3),
      tent_set([X,Y], [5,5]).

    hello[1]: chg(1, 7)
    hello[2]: chg(2, 3)
    hello[1]: chg(7, 5)
    hello[2]: chg(3, 5)

    Xs = [X{5 -&gt; 0}, Y{5 -&gt; 0}]
    There are 2 delayed goals.
    Yes (0.02s cpu)
    </PRE>
<H2>See Also</H2>
<A HREF="../../lib/viewable/index.html">library(viewable)</A>
</BODY></HTML>
